/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "ged_versao_documento")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "GedVersaoDocumento.findAll", query = "SELECT g FROM GedVersaoDocumento g")})
public class GedVersaoDocumento implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    @Basic(optional = false)
    @Column(nullable = false)
    private int versao;
    @Basic(optional = false)
    @Column(name = "DATA_HORA", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date dataHora;
    @Basic(optional = false)
    @Column(name = "HASH_ARQUIVO", nullable = false, length = 250)
    private String hashArquivo;
    @Basic(optional = false)
    @Column(nullable = false, length = 250)
    private String caminho;
    private Character acao;
    @JoinColumn(name = "ID_COLABORADOR", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private Colaborador idColaborador;
    @JoinColumn(name = "ID_GED_DOCUMENTO", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private GedDocumento idGedDocumento;

    public GedVersaoDocumento() {
    }

    public GedVersaoDocumento(Integer id) {
        this.id = id;
    }

    public GedVersaoDocumento(Integer id, int versao, Date dataHora, String hashArquivo, String caminho) {
        this.id = id;
        this.versao = versao;
        this.dataHora = dataHora;
        this.hashArquivo = hashArquivo;
        this.caminho = caminho;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getVersao() {
        return versao;
    }

    public void setVersao(int versao) {
        this.versao = versao;
    }

    public Date getDataHora() {
        return dataHora;
    }

    public void setDataHora(Date dataHora) {
        this.dataHora = dataHora;
    }

    public String getHashArquivo() {
        return hashArquivo;
    }

    public void setHashArquivo(String hashArquivo) {
        this.hashArquivo = hashArquivo;
    }

    public String getCaminho() {
        return caminho;
    }

    public void setCaminho(String caminho) {
        this.caminho = caminho;
    }

    public Character getAcao() {
        return acao;
    }

    public void setAcao(Character acao) {
        this.acao = acao;
    }

    public Colaborador getIdColaborador() {
        return idColaborador;
    }

    public void setIdColaborador(Colaborador idColaborador) {
        this.idColaborador = idColaborador;
    }

    public GedDocumento getIdGedDocumento() {
        return idGedDocumento;
    }

    public void setIdGedDocumento(GedDocumento idGedDocumento) {
        this.idGedDocumento = idGedDocumento;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GedVersaoDocumento)) {
            return false;
        }
        GedVersaoDocumento other = (GedVersaoDocumento) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.GedVersaoDocumento[ id=" + id + " ]";
    }
    
}
